﻿<%@ Page Title="distribution" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="lcs.Web.distribution.List" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" src="/js/CheckBox.js" type="text/javascript"></script>  
    <script src="../../My97DatePicker/WdatePicker.js"></script>
       <link href="../../jquery-ui.min.css" rel="stylesheet" />   
    <script src="../../js/jquery-ui.min.js"></script>
     <script type="text/javascript">
         $(function () {
             $("#<%# txtKeyword2.ClientID%>").autocomplete({
                 minLength: 2, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../../Handler.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { label: item.projectName + item.proid, value: item.projectName };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
         </script>
    <style type="text/css">
        .auto-style1 {
            width: 965px;
        }
        .red td{ background-color:red;
        }
        .auto-style2 {
            width: 10px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<!--Title -->

            <!--Title end -->

            <!--Add  -->

            <!--Add end -->

            <!--Search -->
            <table style="width: 100%;" cellpadding="2" cellspacing="1" class="border">
                <tr>
                    <td align="right" class="auto-style2">
                         
                    </td>
                    <td class="auto-style1">                       
                    
                      <b>项目名：</b>  <asp:TextBox ID="txtKeyword2" runat="server" Width="150px"></asp:TextBox>
                    
                    &nbsp;<b>物料描述：</b><asp:TextBox ID="txtKeyword" runat="server" Width="84px"></asp:TextBox><b>状态：</b><asp:DropDownList ID="ddltype" runat="server">
                            <asp:ListItem Value="0" >所有</asp:ListItem>
                            <asp:ListItem Value="1" Selected="True">正常</asp:ListItem>
                         <asp:ListItem Value="2">已完成</asp:ListItem>
                            <asp:ListItem Value="3">已过期</asp:ListItem>
                        </asp:DropDownList>
                        <b>发运通知单状态：</b>
                        <asp:DropDownList ID="ddlfy" runat="server">
                            <asp:ListItem Value="-1" Selected="True">所有</asp:ListItem>
            <asp:ListItem Value="0" >未确认</asp:ListItem>
            <asp:ListItem Value="1">已确认</asp:ListItem>
        </asp:DropDownList>
                        <b>供应月：</b>  <asp:TextBox ID="txtmonth" runat="server" Width="43px" onfocus="WdatePicker({dateFmt:'yyyy-MM',readOnly:true})"></asp:TextBox>
                    <asp:Button ID="btnSearch" runat="server" Text="查询"  OnClick="btnSearch_Click" >
                    </asp:Button>                    
                        
                    </td>
                    <td class="tdbg">
                        配送月开始日期为：                        <asp:Label ID="lblmsg1" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                        ，配送月结束日期为： <asp:Label ID="lblmsg2" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
            </table>
            <!--Search end-->
            <br />
            <asp:GridView ID="gridView" runat="server" AllowPaging="True" Width="1800px" BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv" GridLines="None"  OnPageIndexChanging ="gridView_PageIndexChanging"
                     DataKeyNames="did" OnRowDataBound="gridView_RowDataBound"
                    AutoGenerateColumns="False"  RowStyle-HorizontalAlign="Center" PageSize="20">
                    <Columns>
                    <asp:TemplateField ControlStyle-Width="30" HeaderText="选择" >
                                <HeaderTemplate>
                                    <input id="Checkbox1" type="checkbox" onclick="javascript:chall(this)" />                                    
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="DeleteThis" runat="server" />
                                </ItemTemplate>

<ControlStyle Width="30px"></ControlStyle>
                            </asp:TemplateField> 
                            
		<asp:BoundField DataField="proid" HeaderText="项目编号"  ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="项目名称">                            
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Decode(Eval("projectname").ToString()) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
		                <asp:BoundField DataField="supplyDate" DataFormatString="{0:D}" HeaderText="供应日期" />
                        <asp:BoundField DataField="mbm" HeaderText="物料编码" />
                        <asp:BoundField DataField="material" HeaderText="物料描述" />
		<asp:BoundField DataField="dnum" HeaderText="配送数量" SortExpression="dnum" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="reqstate" HeaderText="发运通知单确认状态" SortExpression="reqstate" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="reqdate" HeaderText="发运通知单确认日期" SortExpression="reqdate" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:D}"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="dbatch" HeaderText="配送批次" SortExpression="dbatch" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="aognum" HeaderText="已到货数量" SortExpression="aognum" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="pinum" HeaderText="已初验数量" SortExpression="pinum" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="handling" HeaderText="装卸费标准" SortExpression="handling" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="charges" HeaderText="装卸费" SortExpression="charges" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:C}"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="linkman" HeaderText="物流联系人" SortExpression="linkman" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="linkway" HeaderText="物流联系方式" SortExpression="linkway" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="handmode" HeaderText="装卸方式备注" SortExpression="handmode" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="dstatecn" HeaderText="状态" SortExpression="dstate" ItemStyle-HorizontalAlign="Center"  > 
                            
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                            
                            <asp:HyperLinkField HeaderText="详细" ControlStyle-Width="50" DataNavigateUrlFields="did" DataNavigateUrlFormatString="Show.aspx?id={0}"
                                Text="详细"  >
<ControlStyle Width="50px"></ControlStyle>
                        </asp:HyperLinkField>
                            <asp:HyperLinkField HeaderText="编辑" ControlStyle-Width="50" DataNavigateUrlFields="did" DataNavigateUrlFormatString="Modify.aspx?id={0}"
                                Text="编辑"  >
<ControlStyle Width="50px"></ControlStyle>
                        </asp:HyperLinkField>
                            <asp:TemplateField ControlStyle-Width="50" HeaderText="删除"   Visible="false"  >
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                                         Text="删除"></asp:LinkButton>
                                </ItemTemplate>

<ControlStyle Width="50px"></ControlStyle>
                            </asp:TemplateField>
                        </Columns>

                    <PagerStyle CssClass="mypager" />

<RowStyle HorizontalAlign="Center"></RowStyle>
                </asp:GridView>
               <table border="0" cellpadding="0" cellspacing="1" style="width: 100%;">
                <tr>
                    <td style="width: 1px;">                        
                    </td>
                    <td align="left">
                        发运通知单确认：<asp:DropDownList ID="ddlsta" runat="server">
            <asp:ListItem Value="0">未确认</asp:ListItem>
            <asp:ListItem Value="1">已确认</asp:ListItem>
        </asp:DropDownList>
                        <asp:Button ID="btnOK" runat="server" Text="确定" OnClick="btnOK_Click" OnClientClick="return chtest()" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="btnDelete" runat="server" Text="删除" OnClick="btnDelete_Click" OnClientClick="return chtest()"/>                       
                    &nbsp;</td>
                </tr>
            </table>
</asp:Content>
<%--<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceCheckright" runat="server">
</asp:Content>--%>
